# import smtplib
# from email.mime.text import MIMEText
#
# subject = '你快乐吗？'    # 邮件主题
#
# content = '''
# 没有什么是一顿海底捞解决不了的，如果有，那就再来一顿吧！
# '''    # 邮件类容
#
# sender = '1041369205@qq.com'
#
# receiver = """
#     1033220883@qq.com,
#     1041360205@qq.com
# """
#
# password = 'bazaddnxsdvqbefa'
#
# message = MIMEText(content, 'plain', 'utf-8')
# """
#     content：发送内容
#     plain：内容类型
#     utf-8：编码格式
# """
#
# # 主题
# message['Subject'] = subject
# # 从哪里发送
# message['From'] = sender
# # 发送到哪里
# message['To'] = receiver
#
# # 邮箱端口
# smtp = smtplib.SMTP_SSL('smtp.qq.com', 465)
# # 登录邮箱
# smtp.login(sender, password)
# # 发送邮箱
# smtp.sendmail(sender, receiver.split(',\n'), message.as_string())

'___________________________________________________________________'

import smtplib
from email.mime.text import MIMEText


def sendMail():
    # 邮箱端口
    smtp = smtplib.SMTP_SSL('smtp.qq.com', 465)
    # 登录邮箱
    smtp.login(sender, password)
    # 发送邮箱
    smtp.sendmail(sender, receiver.split(',\n'), message.as_string())


if __name__ == '__main__':
    # 主题
    subject = '拳头'
    # 内容
    content = '''
    哟哟哟，拳头举起来
    '''
    # 发送人
    sender = '1041369205@qq.com'
    # 接收人
    receiver = '''
        1041369205@qq.com,
        1033220883@qq.com
    '''
    # 授权码登录
    password = 'bazaddnxsdvqbefa'
    # 信息
    message = MIMEText(content, 'plain', 'utf-8')
    # content 发送内容
    # plain   text就是plain   html就是html
    # utf-8   编码格式

    # 主题
    message['Subject'] = subject
    # 从哪里发送
    message['From'] = sender
    # 发送到哪里
    message['To'] = receiver
    sendMail()
